package com.cdie.myschool.controller;

import com.cdie.myschool.common.R;
import com.cdie.myschool.domain.dto.StudentDTO;
import com.cdie.myschool.service.StudentTermReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigInteger;

/**
 * @author 明祺奇-199000331
 * @date 2022/10/5 - 9:29
 */
@RestController
@RequestMapping("/studentTermReport")
public class StudentTermReportController {
    @Autowired
    private StudentTermReportService studentTermReportService;

    /**
     * 功能描述: 根据传入的学号查找并返回姓名和入学时长到启动页
     * @Param: [studentDTO]
     * @Return: com.cdie.myschool.common.R
     * @Author: 朱华扬
     * @Date: 2022/10/11 8:39
     */
    @RequestMapping("/startupPage")
    public R StartupPage(@RequestBody StudentDTO studentDTO){
        return studentTermReportService.startupPage(studentDTO);
    }

    /**
     * 功能描述:根据传入学号查找并返回入学时间、学院、专业、班级、学号到院系信息页面
     * @Param: [studentDTO]
     * @Return: com.cdie.myschool.common.R
     * @Author: 朱华扬
     * @Date: 2022/10/11 8:39
     */
    @RequestMapping("/departmentInformation")
    public R DepartmentInformation(@RequestBody StudentDTO studentDTO){
        return studentTermReportService.departmentInformation(studentDTO);
    }

    /**
     * 功能描述:根据传入学号查找并返回学期名、本学期课程数量、累计已修课程数量、本学期课程名称
     * @Param: [studentDTO]
     * @Return: com.cdie.myschool.common.R
     * @Author: 朱华扬
     * @Date: 2022/10/11 8:39
     */
    @RequestMapping("/courseInformation")
    public R CourseInformation(@RequestBody StudentDTO studentDTO){
        return studentTermReportService.courseInformation(studentDTO);
    }

    /**
     * 功能描述: 根据传入学号查找本学期奖学金内容和本学期素质教育积分
     * @Param: [studentDTO]
     * @Return: com.cdie.myschool.common.R
     * @Author: 朱华扬
     * @Date: 2022/10/12 20:12
     */
    @RequestMapping("/studentEngineeringData")
    public R StudentEngineeringData(@RequestBody StudentDTO studentDTO){
        return studentTermReportService.studentEngineeringData(studentDTO);
    }
    /**
     * @Description: 根据学号和学期Id查询学生图书馆的数据信息
     * @Param: [studentDTO]
     * @return: com.cdie.myschool.common.R
     * @Author: 毛康源
     * @Date: 2022/10/12
     */
    @RequestMapping("/libraryData")
    public R LibraryData(@RequestBody StudentDTO studentDTO){
        return studentTermReportService.libraryData(studentDTO);
    }

    /**
     * @author 明祺奇
     * 成绩分析
     */
    @GetMapping("/scoreAnalysis")
    public R scoreAnalysis(@RequestParam BigInteger studentId) {
        return studentTermReportService.scoreAnalysis(studentId);
    }
    /**
     * @author 明祺奇
     * 成绩分析成绩表
     */
    @GetMapping("/scoreAnalysisScoreInfo")
    public R scoreAnalysisScoreInfo(@RequestParam BigInteger studentId) {
        return studentTermReportService.scoreAnalysisScoreInfo(studentId);
    }


}
